import javax.xml.crypto.Data;
import java.util.stream.Stream;

public class Books {
    private int id;
    public String name;
    private Data data;
    private String author;
    private double price;

    public Books(){}
    public Books(String name){
        this.name = name;
    }
    private Books(int id, String name){
        this.id = id;
        this.name = name;
    }
    private Books(int id, String author,double price){
        this.id = id;
        this.author = author;
        this.price = price;
    }
    public Books(int id, String author,double price, String name){
        this.id = id;
        this.author = author;
        this.price = price;
        this.name = name;
    }

    public Books(int id, String name, Data data, String author, double price) {
        this.id = id;
        this.name = name;
        this.data = data;
        this.author = author;
        this.price = price;
    }

    public void read(String name){
        System.out.println("read");
    }

    private void buy(double price){
        System.out.println("buy");
    }
    @Override
    public String toString() {
        return "Books{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", data=" + data +
                ", author='" + author + '\'' +
                ", price=" + price +
                '}';
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Data getData() {
        return data;
    }

    public void setData(Data data) {
        this.data = data;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }
}
